<template>
  <div class="container">
    <el-form
      :inline="true"
      label-width="80px"
      :model="registerForm"
      class="form-inline"
    >
      <div class="div-info">
        <p>建册登记</p>
        <el-row :span="24">
          <el-col :span="12">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="registerForm.name" placeholder="请输入姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="年龄" prop="age">
              <el-input v-model="registerForm.age" placeholder="请输入年龄" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :span="24">
          <el-col :span="12">
            <el-form-item label="身份证号">
              <el-input
                v-model="registerForm.idCard"
                placeholder="请输入身份证号"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号">
              <el-input
                v-model="registerForm.phone"
                placeholder="请输入手机号"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="div-history">
        <p>孕产史信息</p>
        <el-form-item label="孕次">
          <el-input v-model="registerForm.gravidity" placeholder="请输入孕次" />
        </el-form-item>
        <el-form-item label="产次">
          <el-input v-model="registerForm.parity" placeholder="请输入产次" />
        </el-form-item>
      </div>
      <div class="div-now">
        <p>现有病史</p>
        <el-form-item label="既往病史">
          <el-input
            v-model="registerForm.medicalHistory"
            placeholder="请输入既往病史"
            type="textarea"
          />
        </el-form-item>
      </div>
      <div class="div-btn">
        <el-form-item>
          <el-button color="#2563eb" @click="commitBook">提交建册</el-button>
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import { ElMessage } from "element-plus";

const registerForm = reactive({
  name: "",
  age: null,
  idCard: null,
  phone: "",
  gravidity: null, //孕次
  parity: null, //产次
  medicalHistory: [],
});
const commitBook = () => {
  ElMessage.success("提交预约建册信息成功");
};
</script>

<style scoped>
.form-inline p {
  font-size: 24px;
  color: #6b7280;
  margin-bottom: 20px;
}

.form-inline > div {
  margin-bottom: 20px;
}

.form-inline input {
  width: 220px;
}

.form-inline .el-form-item {
  width: 100%;
}

.div-info {
  width: 100%;
}

.div-btn {
  text-align: center;

  .el-form-item {
    width: 0%;
  }
}
</style>
